﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MessageCallAspect.Inspector.Attributes;
using System.Runtime.Remoting.Messaging;

namespace MessageCallAspect.Aspect.Log
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
    public sealed class LogAspectAttribute : MessageSinkAttribute
    {
        public LogAspectAttribute()
        {
            Order = int.MinValue;
        }

        public string Category { get; set; }

        public override IMessageSink CreateMessageSink(IServiceProvider context, object target, IMessageSink nextSink)
        {
            return new LogMessageSink(context, target, Category, nextSink);
        }
    }
}
